package com.huawei.appgallery.agreementimpl.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Nullable;
import com.huawei.hwid.core.constants.HwAccountConstants;
import java.util.Locale;
import o.axb;
import o.axg;
import o.ayy;
import o.azj;
import o.Logger;
import o.fho;

public class LocalPrivacyActivity extends Activity {
    protected void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
        ॱ();
    }

    private void ॱ() {
        boolean ॱ = axg.ˏ().ॱ(this);
        Logger.ˎ("LocalPrivacyActivity", "isOOBE = " + ॱ);
        if (ॱ) {
            ayy.ˋ().ˎ(getWindow());
            ((azj) fho.ˏ().ˋ("AGWebView").ॱ(azj.class)).ॱ(this, "user_privacy_webview", ˋ(), false, HwAccountConstants.FLAG_TRANSLUCENT_STATUS);
            return;
        }
        axb.ˎ(this, axg.ˏ().ˎ());
    }

    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        ॱ();
    }

    protected void onResume() {
        super.onResume();
        finish();
    }

    private String ˋ() {
        String country;
        if ("zh".equalsIgnoreCase(Locale.getDefault().getLanguage().toLowerCase(Locale.ENGLISH))) {
            country = Locale.getDefault().getCountry();
            if (!("tw".equalsIgnoreCase(country) || "hk".equalsIgnoreCase(country))) {
                return "file:///android_asset/privacy/privacy-statement-zh-cn.htm";
            }
        }
        country = Locale.getDefault().getLanguage() + "_" + Locale.getDefault().getCountry();
        Logger.ˏ("LocalPrivacyActivity", "languageAndCountry = " + country);
        String toLowerCase = country.toLowerCase(Locale.ENGLISH);
        Object obj = -1;
        switch (toLowerCase.hashCode()) {
            case 93906333:
                if (toLowerCase.equals("bo_cn")) {
                    obj = 1;
                    break;
                }
                break;
            case 96647668:
                if (toLowerCase.equals("en_us")) {
                    obj = 5;
                    break;
                }
                break;
            case 111214904:
                if (toLowerCase.equals("ug_cn")) {
                    obj = 2;
                    break;
                }
                break;
            case 115862300:
                if (toLowerCase.equals("zh_cn")) {
                    obj = null;
                    break;
                }
                break;
            case 115862452:
                if (toLowerCase.equals("zh_hk")) {
                    obj = 3;
                    break;
                }
                break;
            case 115862836:
                if (toLowerCase.equals("zh_tw")) {
                    obj = 4;
                    break;
                }
                break;
        }
        switch (obj) {
            case null:
                return "file:///android_asset/privacy/privacy-statement-zh-cn.htm";
            case 1:
                return "file:///android_asset/privacy/privacy-statement-bo-cn.htm";
            case 2:
                return "file:///android_asset/privacy/privacy-statement-ug-cn.htm";
            case 3:
                return "file:///android_asset/privacy/privacy-statement-zh-hk.htm";
            case 4:
                return "file:///android_asset/privacy/privacy-statement-zh-tw.htm";
            default:
                return "file:///android_asset/privacy/privacy-statement-en-us.htm";
        }
    }
}
